#ifndef SQLMANAGE_H
#define SQLMANAGE_H

#include <QObject>
#include <QThread>
#include "IDataBaseWorker.h"
#include "WgtSqlManage.h"
#include "WgtSqlStatus.h"

#define TableNameRecord "Record"
#define TableNameStatistics "Statistics"
#define TableNameUser "User"
#define TableNameSolution "Solution"


class SqlManage : public QObject
{
    Q_OBJECT
public:
    explicit SqlManage(QObject *parent = nullptr);

    void setupRecord();
    void setupStatistics();
    void setupUser();
    void setupSolution();

    void setConfigWriteOneFunc(void (*func)(QString name, const SqlLinkParam& config));
    void setConfigReadOneFunc(SqlLinkParam (*func)(QString camName));

signals:

public:
    QMap<QString, IDataBaseWorker*> mapSqlWorker;
    QMap<QString, QThread*> mMapSqlThread;

    WgtSqlManage* wgtSqlManage;
    WgtSqlStatus* wgtSqlStatus;

    void (*configWriteOne)(QString name, const SqlLinkParam& config);
    SqlLinkParam (*configReadOne)(QString camName);

};

#endif // SQLMANAGE_H
